import commonjs from 'rollup-plugin-commonjs';
import resolve from 'rollup-plugin-node-resolve';
// 本地服务
import serve from 'rollup-plugin-serve';
// 热更新
import livereload from 'rollup-plugin-livereload';
// 指定文件原样输出
import sourcemaps from 'rollup-plugin-sourcemaps';

export default {
  input: 'src/main.js',
  output: [
    {
      file: 'example/dist.umd.js',
      format: 'umd',
      name: 'Test',
      sourcemap: true
    },
    {
      file: 'dist/dist.esm.js',
      format: 'es',
    }
  ],
  paths: {
    '@': './src',
    '@lib': './src/lib'
  },
  plugins: [
    resolve(),
    commonjs(),
    serve({
      open: true,
      contentBase: ['example', 'dist'],
      port: 8085
    }),
    livereload('example'),
    sourcemaps()
  ],
  // external: ['vue']
}